# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.TextToSpeech.V1.Model.SynthesisInput do
  @moduledoc """
  Contains text input to be synthesized. Either `text` or `ssml` must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 bytes.

  ## Attributes

  *   `customPronunciations` (*type:* `GoogleApi.TextToSpeech.V1.Model.CustomPronunciations.t`, *default:* `nil`) - Optional. The pronunciation customizations are applied to the input. If this is set, the input is synthesized using the given pronunciation customizations. The initial support is for en-us, with plans to expand to other locales in the future. Instant Clone voices aren't supported. In order to customize the pronunciation of a phrase, there must be an exact match of the phrase in the input types. If using SSML, the phrase must not be inside a phoneme tag.
  *   `multiSpeakerMarkup` (*type:* `GoogleApi.TextToSpeech.V1.Model.MultiSpeakerMarkup.t`, *default:* `nil`) - The multi-speaker input to be synthesized. Only applicable for multi-speaker synthesis.
  *   `ssml` (*type:* `String.t`, *default:* `nil`) - The SSML document to be synthesized. The SSML document must be valid and well-formed. Otherwise the RPC will fail and return google.rpc.Code.INVALID_ARGUMENT. For more information, see [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
  *   `text` (*type:* `String.t`, *default:* `nil`) - The raw text to be synthesized.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :customPronunciations => GoogleApi.TextToSpeech.V1.Model.CustomPronunciations.t() | nil,
          :multiSpeakerMarkup => GoogleApi.TextToSpeech.V1.Model.MultiSpeakerMarkup.t() | nil,
          :ssml => String.t() | nil,
          :text => String.t() | nil
        }

  field(:customPronunciations, as: GoogleApi.TextToSpeech.V1.Model.CustomPronunciations)
  field(:multiSpeakerMarkup, as: GoogleApi.TextToSpeech.V1.Model.MultiSpeakerMarkup)
  field(:ssml)
  field(:text)
end

defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.SynthesisInput do
  def decode(value, options) do
    GoogleApi.TextToSpeech.V1.Model.SynthesisInput.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.SynthesisInput do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
